package admin;

import java.rmi.RemoteException;

import org.omg.CORBA.StringHolder;

import administrator.administratorService;
import common.CommonTools;

public class AdminClient {

	private administratorService administratorService;

	public AdminClient(administratorService administratorService) {
		this.administratorService = administratorService;
	}

	public String getPlayerStatus(String adminName, String adminPassword,String adminIPAddress) {
		
			CommonTools.writeLog("client", "client", "get player status started:"
					+ "adminName:" + adminName + "; adminIPAddress:"
					+ adminIPAddress, false);
			StringHolder status = new StringHolder();
			administratorService.getPlayerStatus(adminName,adminPassword, adminIPAddress,status );
			
			CommonTools.writeLog("client", "client", "get player status succeeded:" + status.value, false);
			return status.value;
	}
	
	
	public String suspendAccount(String adminName, String adminPassword,String adminIPAddress,String userNameToSuspend) {
		
		CommonTools.writeLog("client", "client", "suspend Account started:"
				+ "adminName:" + adminName + "; adminIPAddress:"
				+ adminIPAddress+" userNameToSuspend: "+userNameToSuspend, false);
		
		StringHolder status = new StringHolder();
		administratorService.suspendAccount(adminName,adminPassword, adminIPAddress,userNameToSuspend,status );
		
		CommonTools.writeLog("client", "client", "suspend Account succeeded:" + status.value, false);
		return status.value;
		
	
}

}
